package controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import pojo.Categories;
import service.CategoriesService;

@Controller
public class CategoriesController {

	@Resource(name = "categoriesServiceImpl")
    private CategoriesService categoriesService;
	
	@ResponseBody
	@RequestMapping(value="/getCategoriesList",method = RequestMethod.GET)
	public List<Categories> getFoodList(){
		List<Categories> categoriesList = categoriesService.findAll();
		return categoriesList;
	}
}
